/*
 * DisjointSet.hpp
 *
 *  Created on: 28 Oct 2013
 *      Author: Patrick
 */

#ifndef DISJOINTSET_HPP_
#define DISJOINTSET_HPP_

namespace Engine {

struct Node {
	int value;
	int rank;
	Node* parent;
};

class DisjointSet {
private:
	std::vector<Node*> nodes;

	Node* findRootNode(int);
//	Node* findRootNode(Node* n);

public:
	DisjointSet();
	~DisjointSet();

	void insert(unsigned int x);

	int findRootValue(int x);

	void Union(int x, int y);

	std::vector<int> getRoots();
};

}



#endif /* DISJOINTSET_HPP_ */
